<script setup lang="ts">

import {useAppStore} from "@/stores";
import {darkTheme, dateZhCN, zhCN} from 'naive-ui'

const appStore = useAppStore();
const registerNaiveTools = () => {
  window.$loadingBar = useLoadingBar()
  window.$message = useMessage()
  window.$dialog = useDialog()
  window.$notification = useNotification()
}
const naiveProviderContent = defineComponent({
  name: 'NaiveProviderContent',
  setup() {
    registerNaiveTools();
  },
  render() {
    return h('div');
  }
});
</script>

<template>
  <n-config-provider
      :theme="appStore.darkTheme ? darkTheme : null"
      :locale="zhCN"
      :date-locale="dateZhCN"
      wh-full absolute>
    <n-modal-provider>
      <n-dialog-provider>
        <n-notification-provider :max="3">
          <n-message-provider>
            <n-loading-bar-provider>
              <slot name="default"></slot>
              <naive-provider-content/>
            </n-loading-bar-provider>
          </n-message-provider>
        </n-notification-provider>
      </n-dialog-provider>
    </n-modal-provider>
  </n-config-provider>
</template>

<style scoped>

</style>
